package com.wbt.huawei.main0730;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        String str = null;
        while (( str = bf.readLine()) != null){
            char[] sc = str.toCharArray();
            char c = bf.readLine().charAt(0);
            for (int i=0; i<sc.length;i++){
                if(c != sc[i]){
                    System.out.print(sc[i]);
                }
            }
        }

    }
}
